hysop.backend.device.kernel_autotuner module

class hysop.backend.device.kernel_autotuner.KernelAutotuner(name, tunable_kernel, **kwds)[source]

Bases: object

Initialize a KernelAutotuner.

Parameters:
  • name (str) – Name of this Autotuner for logging and caching purposes.

  • tunable_kernel (TunableKernel) – The kernel to be tuned.

DUMP_LAST_TUNED_KERNEL = False
FULL_RESULTS_KEY = '__FULL_RESULTS__'
STORE_FULL_KERNEL_SOURCES = False
autotune(extra_kwds, first_working=False, force_verbose=False, force_debug=False)[source]

Autotune the target tunable_kernels.

Parameters:
  • first_working – Disable caching, build and execute first valid kernel at most one time.

  • extra_kwds (dict) – Extra keywords used to tune the kernel.

abstract autotuner_config_key()[source]

Caching key for autotuner configurations.

abstract bench_one_from_binary(kernel, global_work_size, local_work_size, target_nruns, old_stats, best_stats, force_verbose, force_debug)[source]

Compile and bench one kernel by executing it nruns times. Return the compiled kernel, KernelStatistics and whether it was pruned or not.

bench_one_from_source(tkernel, kernel_name, kernel_src, args_list, args_mapping, isolation_params, global_work_size, local_work_size, target_nruns, old_stats, best_stats, force_verbose, force_debug)[source]

Compile and bench one kernel by executing it nruns times. Return the compiled kernel, KernelStatistics and whether it was pruned or not.

abstract build_from_source(kernel_name, kernel_src, build_options, force_verbose, force_debug)[source]

Compile one kernel from source. Return the compiled program and the kernel.

cache_dir()[source]
cache_file()[source]
abstract check_kernel(tkernel, kernel, global_work_size, local_work_size)[source]
abstract check_kernel_args(kernel, args_list)[source]
abstract collect_kernel_infos(tkernel, extra_parameters, extra_kwds)[source]

Collect kernel infos before computing workload and work group size.

use_system_cache()[source]
use_tmp_cache()[source]
exception hysop.backend.device.kernel_autotuner.KernelGenerationError[source]

Bases: RuntimeError